define([], function() {
	 'use strict';

	function getClientRect (jqElement) {
		var ret = {left: 0, top: 0, right: 0, bottom: 0 };
		if (jqElement && jqElement.length > 0){
			  var offset = jqElement.offset();
			  ret.left = offset.left;
			  ret.top = offset.top;
			  ret.right = ret.left + jqElement[0].clientWidth;
			  ret.bottom = ret.top + jqElement[0].clientHeight;
		}
		return ret;
	}


   /**
     * @description Check whether a point is in a specified rectangle.
		 * @param {WebPDF.PDFRect} srcRect The PDFRect object.
		 * @example 
			var isPtInRect = WebPDF.RectUtils.ptInRect(rect, point);
			var isPtInRect = WebPDF.RectUtils.ptInRect(rect, x, y);
     * @return {Boolean} Return true if the point is in the rectangle, otherwise return false.
     */
    function ptInRect (srcRect) {
        var x = 0, y = 0;
        if (arguments.length == 2) {
            x = arguments[1].x;
            y = arguments[1].y;
        } else if (arguments.length == 3 && !isNaN(arguments[1]) && !isNaN(arguments[2])) {
            x = arguments[1];
            y = arguments[2];
        }
        return (x >= srcRect.left && x <= srcRect.right && y >= srcRect.top && y <= srcRect.bottom);
    }

	var RectUtils = {
		'getClientRect' : getClientRect,
		'ptInRect' : ptInRect	
	};

	return RectUtils;
});